import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Jiang Jinxi
 * Date: 2024-03-02
 * Time: 18:31
 */
public class Main {
    public static void main(String[] args) {
        System.out.print("Enter the time zone offset to GMT:");
        Scanner scanner = new Scanner(System.in);
        int offset = scanner.nextInt();
        long totalMilliseconds = System.currentTimeMillis();
        long totalSeconds = totalMilliseconds / 1000;
        long currentSecond = totalSeconds % 60;
        long totalMinutes = totalSeconds / 60;
        long currentMinute = totalMinutes % 60;
        long totalHours = totalMinutes / 60;
        long currentHour = totalHours % 24;
        if(currentHour+offset < 0){
            currentHour = 24 + currentHour + offset;
        }else if(currentHour+offset >24){
            currentHour = currentHour + offset - 24;
        }else{
            currentHour = currentHour + offset;
        }
        System.out.println("Current time is " + currentHour + ":" + currentMinute + ":" + currentSecond + " GMT");
    }
}
